import ray

ray.init()
from process_pdf_enroll import BatchDocInfer

# Define an actor that uses 0.5 GPU
@ray.remote(num_gpus=1)
def GPUActor():
    infer = BatchDocInfer("s3://llm-pdf-text-1/meta-index/scihub/v001/scihub/part-66210c190659-018706.jsonl", True, True)
    infer() 
    return 0

# Create actors
if 0:
    results = ray.get(GPUActor.remote())
if 1:
    futures = [GPUActor.remote() for _ in range(2)]
    results = ray.get(futures)

print(results)

